body {
    pointer-events: auto;
    touch-action: none;
    background-color: #000000;
}

.dice-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    --dice-w: 100px;
    --dot-w: 20px;
    --dice-alpha: 1;
}

.horizion,
.vertical,
.cube {
    transform-style: preserve-3d;
}

.horizion {
    width: 30vw;
    height: 30vw;
    /* background-color: #c9c9c9; */
    animation: horizion360 5s linear infinite;
}

.vertical {
    width: 100%;
    height: 100%;
    animation: vertical360 5s linear infinite;
}
.cube {
    width: 100%;
    height: 100%;
    position: relative;
    transform: rotateX(-45deg) rotateY(45deg);
}

div[class$='dice'] {
    /* width: calc(var(--dice-w) - 40px);
	height: calc(var(--dice-w) - 40px); */

    width: calc(var(--dice-w));
    height: calc(var(--dice-w));
    box-sizing: border-box;
    /* width: 100px;
    height: 100px; */

    background-color: #ffffff;
    padding: 20px;
    border-radius: 45%;
    opacity: var(--dice-alpha);
    position: absolute;
    top: calc(50% - var(--dice-w) / 2);
    left: calc(50% - var(--dice-w) / 2);
    transform-style: preserve-3d;
    box-shadow: 0 0 calc(var(--dice-w) / 5) #ccc inset;
}

div[class$='dice']:after {
    content: '';
    display: block;
    border-radius: 30%;
    transform: translateZ(-0.1px);
    background-color: #e0e0e0;
    position: absolute;
    top: 0;
    left: 0;
    width: var(--dice-w);
    height: var(--dice-w);
}

/* .dice {}
 */
.dot {
    width: var(--dot-w);
    height: var(--dot-w);
    background-color: #444;
    border-radius: 50%;
    box-shadow: inset 4px 4px 8px #000000;
}

.one-dice {
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateZ(calc(0.5 * var(--dice-w)));
    /* background-color: red; */
}

.two-dice {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    /* transform: translateX( calc(-1 * var(--dice-w)) ); */
    transform: translateX(-50%) rotateY(-90deg);
    /* background-color: orange; */
}

.two-dice > .dot:nth-child(2) {
    align-self: flex-end;
}

.three-dice {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* transform: translateX( calc(-1 * var(--dice-w)) ) translateY(var(--dice-w)); */
    transform: translateY(50%) rotateX(-90deg);
    /* background-color: yellow; */
}

.three-dice > .dot:nth-child(1) {
    align-self: flex-start;
}

.three-dice > .dot:nth-child(3) {
    align-self: flex-end;
}

.four-dice {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    /* transform: translateX( calc(-1 * var(--dice-w)) ) translateY( calc(-1 * var(--dice-w)) ); */
    transform: translateY(-50%) rotateX(90deg);
    /* background-color: green; */
}

.four-dice > .dot:nth-child(1) {
    margin-right: calc(100% - var(--dot-w) * 2);
    margin-bottom: calc(100% - var(--dot-w) * 2);
}

.four-dice > .dot:nth-child(3) {
    margin-right: calc(100% - var(--dot-w) * 2);
}

.five-dice {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    /* transform: translateX( var(--dice-w) ); */
    transform: translateX(50%) rotateY(90deg);
    /* background-color: blue; */
}

.five-dice > .dot:nth-child(1) {
    margin-right: calc(100% - var(--dot-w) * 2);
    margin-bottom: calc(50% - var(--dot-w) * 1.5);
}

.five-dice > .dot:nth-child(3) {
    margin-left: calc(50% - var(--dot-w) / 2);
    margin-right: calc(50% - var(--dot-w) / 2);
    margin-bottom: calc(50% - var(--dot-w) * 1.5);
}

.five-dice > .dot:nth-child(4) {
    margin-right: calc(100% - var(--dot-w) * 2);
}

.six-dice {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-content: space-between;
    /* transform: translateX( calc(-2 * var(--dice-w)) ); */
    transform: translateZ(calc(-0.5 * var(--dice-w))) rotateY(180deg);
    /* background-color: purple; */
}

.six-dice > .dot:nth-child(1),
.six-dice > .dot:nth-child(2),
.six-dice > .dot:nth-child(4),
.six-dice > .dot:nth-child(5) {
    margin-bottom: calc(50% - var(--dot-w) * 1.5);
}

div[class$='flat'] {
    --dw: 98px;

    /* width: calc(var(--dice-w));
	height: calc(var(--dice-w)); */

    width: calc(var(--dw));
    height: calc(var(--dw));

    background: #e0e0e0;
    background-clip: border-box;
    /* opacity: var(--dice-alpha); */
    /* opacity: 1; */
    position: absolute;
    top: calc(50% - var(--dw) / 2);
    left: calc(50% - var(--dw) / 2);
}

.fill-horizion-flat {
    transform: rotateX(90deg);
}

.fill-vertical-90-flat {
    transform: rotateY(90deg);
}

@keyframes horizion360 {
    from {
        transform: rotateY(0deg);
    }

    to {
        transform: rotateY(360deg);
    }
}

@keyframes vertical360 {
    from {
        transform: rotateX(0deg);
    }

    to {
        transform: rotateX(360deg);
    }
}
